import request from "@/utils/request";
import { v4 as uuidv4 } from 'uuid';

// 申请列表
export function queryRzsqList(data) {
  return request({
    url: `/api/application/getApplicationPageList`,
    method: 'post',
    data
  })
}
// 根据ID查询企业基本信息
export function getEnterpriseById(params) {
  return request({
    url: `/api/enterprise/getById`,
    method: 'get',
    params
  })
}
// 发起提交申请
export function submitRzsq(data) {
  return request({
    url: `/api/application/saveApplicationList`,
    method: 'post',
    data: { data, "rid": uuidv4() }
  })
}
// 获取申请详情
export function getApplicationById(params) {
  return request({
    url: `/api/application/getApplicationById`,
    method: 'get',
    params
  })
}
// 编辑申请
export function updateApplicationById(data) {
  return request({
    url: `/api/application/updateApplicationById`,
    method: 'post',
    data
  })
}
// 新增企业自我承诺
export function addCommit(data) {
  return request({
    url: `/api/commitment/save`,
    method: 'post',
    data: { data, "rid": uuidv4() }
  })
}
// 企业自我承诺列表
export function queryCommit(data) {
  return request({
    url: `/api/commitment/getCommitmentPageList`,
    method: 'post',
    data
  })
}
// 暗访管理列表
export function anfangList(data) {
  return request({
    url: `/api/secretVisit/getVisitPageList`,
    method: 'post',
    data
  })
}
// 暗访管理新增,暗访结果录入
export function addAnfang(data) {
  return request({
    url: `/api/secretVisit/save`,
    method: 'post',
    data: { data, "rid": uuidv4() }
  })
}
// 新增器具
export function addQiju(data) {
  return request({
    url: `/api/instrument/save`,
    method: 'post',
    data: { data, "rid": uuidv4() }
  })
}
// 器具列表展示
export function queryQijuList(data) {
  return request({
    url: `/api/instrument/getInstrumentPageList`,
    method: 'post',
    data
  })
}
//验收结果列表
export function queryYanshouList(data) {
  return request({
    url: `/api/acceptanceResult/getAcceptancePageList`,
    method: 'post',
    data
  })
}
// 查询申请材料
export function getMaterialByApplicationId(data) {
  return request({
    url: `/api/applicationMaterial/getMaterialByApplicationId`,
    method: 'post',
    data
  })
}
// 新增流程
export function addWorkFlow(data) {
  return request({
    url: `/api/workFlow/saveStartFlow`,
    method: 'post',
    data
  })
}
// 查看流程
export function getWorkFlow(params) {
  return request({
    url: `/api/workFlow/getFlowInstCurrentWork`,
    method: 'get',
    params
  })
}
//  获取当前所有流程
export function getOpinionList(params) {
  return request({
    url: `/api/workFlow/getOpinionList`,
    method: 'get',
    params
  })
}
//  获取当前最新流程
export function getOpinion(params) {
  return request({
    url: `/api/workFlow/getOpinion`,
    method: 'get',
    params
  })
}

export function getFlowByActivityId(data) {
  return request({
    url: `/api//flowDict/getFlowByActivityId`,
    method: 'post',
    data
  })
}
// 流程下推
export function saveCompleteWork(data) {
  return request({
    url: `/api/workFlow/saveCompleteWork`,
    method: 'post',
    data
  })
}
// 修改状态
export function reportedDispose(data) {
  return request({
    url: `${window.scjConfig.bzydUrl}/reported/reportedDispose`,
    method: 'post',
    data
  })
}
